﻿/**********************************天使物流*******************************************
* 功能描述:结算管理-销进项票管理
* 作者:石锦涛
* 时间:2022-01-11
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.SettleAccounts.NewSalesInvoices;
using Volo.Abp.Application.Services;

namespace TianShiProject.SettleAccounts.NewSalesInvoices
{
    public class NewSalesApp: ApplicationService
    {
        private readonly INewSalesAppRepository _newSalesAppRepository;

        public NewSalesApp(INewSalesAppRepository newSalesAppRepository)
        {
            _newSalesAppRepository = newSalesAppRepository;
        }

        /// <summary>
        /// 分页显示
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<NewSalesInvoiceDto>> GetNewSales(string name, int? clas, string times, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                return await _newSalesAppRepository.GetNewSales(name,clas,times,pageindex,pagesize);

            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        ///  销项发票逻辑删除
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<NewSalesInvoiceDto>> DeleteNewSales(int Id)
        {
            try
            {
                return await _newSalesAppRepository.DeleteNewSales(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改销项发票
        /// </summary>
        /// <param name="newInput"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> UpdateNewSales(NewSalesInvoiceDto newSales)
        {
            try
            {
                return await _newSalesAppRepository.UpdateNewSales(newSales);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 新增销项发票
        /// </summary>
        /// <param name="newInput"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> PostNewSales(NewSalesInvoiceDto newSales)
        {
            try
            {
                return await _newSalesAppRepository.PostNewSales(newSales);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量逻辑删除销项发票
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task<PageResponse<NewSalesInvoiceDto>> DeleteNewSalesMent(string Id)
        {
            try
            {
                return await _newSalesAppRepository.DeleteNewSalesMent(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }

    }
}
